#include "UI/newUI/SetThermostatDialog.h"

#include "qmessagebox.h"

SetThermostatDialog::SetThermostatDialog(QWidget* parent) :QDialog(parent)
{
	ui.setupUi(this);
	setFixedSize(size());
	connect(ui.pushButton_confirm, &QPushButton::clicked, this, &SetThermostatDialog::accept);
	connect(ui.pushButton_cancel, &QPushButton::clicked, this,&SetThermostatDialog::reject);
}
SetThermostatDialog::~SetThermostatDialog()
{

}

int SetThermostatDialog::exec()
{
	return QDialog::exec();
}

void SetThermostatDialog::accept()
{
	QDialog::accept();
}

float SetThermostatDialog::getTemperature()
{
	return ui.lineEdit_targetTemperature->text().toFloat();
}
float SetThermostatDialog::getRate()
{
	return ui.lineEdit_temperatureRate->text().toFloat();
}

int SetThermostatDialog::getAccuracy()
{
	return  ui.lineEdit_targetTemperature->getAccuracy();
}
void SetThermostatDialog::setAccuracy(int accuracy)
{
	ui.lineEdit_targetTemperature->setAccuracy(accuracy);
	ui.lineEdit_temperatureRate->setAccuracy(accuracy);
}